package com.yjj.interceptor;

import com.yjj.service.IPService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class IPInterceptor  implements HandlerInterceptor {
    @Autowired
    IPService ipService;
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        ipService.count(request);
        return true;
    }
}
